FROM centos:7

WORKDIR /opt/program/jdk1.8/

ADD jdk-8u281-linux-x64.tar.gz /opt/jdk/
ADD demo-0.0.1.jar /opt/

ENV JAVA_HOME=/opt/jdk/jdk1.8.0_281/
ENV CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
ENV PATH=$JAVA_HOME/bin:$PATH

ENTRYPOINT ["java","-jar","/opt/demo-0.0.1.jar"]


#docker build -t jdk8:v1.0 .
#docker build -t demo:v1.0 .
#docker run --name demo -p 444:443 -p 88:80 -itd demo:v1.0 /bin/bash
#docker exec -it demo /bin/bash